<%@ page contentType="text/html;charset=utf-8"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="chen.modal.GoodsSingle" %>
<!-- 通过动作标识，获取ShopCar类实例 -->
<jsp:useBean id="myCar" class="chen.mbeans.ShopCar" scope="session"/>
<%  //获取实例中用来存储购买的商品的集合
    ArrayList buylist=myCar.getBuylist();
    float total=0;//用来存储应付金额
%>
<table border="1" rules="none" cellspacing="0" cellpadding="0">
        <tr height="50"><td colspan="5" align="center">我的购物车</td></tr>
	<tr align="center" height="30" bgcolor="lightgrey">
           <td></td>
	   <td width="25%">名称</td>		
	</tr>
	<%if(buylist==null||buylist.size()==0){ %>
	<tr height="100"><td colspan="5" align="center">您的购物车为空！</td>
        </tr>
	<%
	}
	else{
	   for(int i=0;i<buylist.size();i++){
	   GoodsSingle single=(GoodsSingle)buylist.get(i);
	   String name=single.getName();							//获取商品名称				
           String imgname="img/"+single.getImg();
	%>
	<tr align="center" height="50">
        <td>
        <img src= <%=imgname%> height="60"  
             width="120" hspace="20" vspace="10">
        </td>
	<td><%=name%></td>
	</tr>
    <%
      }
    }
    %>
</table>